home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1986 January & February / rerun-1986-01-02.d64 / autoboot 128 (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  3KB  |  101 lines

  1. 10 rem c128 autoboot disk maker
  2. 15 mo=0:print"[147]":ifpeek(215)<>0then mo=5:goto500
  3. 20 (NULL)1,1:(NULL)0,6:(NULL)4,6
  4. 30 (NULL)1,1
  5. 40 (NULL)"auto.pic" to "auto.pic"
  6. 50 e$=left$(ds$,2)
  7. 60 ife$<>"63"thengosub620:(NULL) (NULL)"auto.col",d0:(NULL)"auto.pic",d0
  8. 70 clr:goto500
  9. 80 rem insert disk
  10. 90 s1$=" insert disk to autoboot"
  11. 100 s2$="press spacebar when ready.":gosub820
  12. 110 (NULL):get(NULL) a$:(NULL) (NULL) a$=" ":gosub850
  13. 120 return
  14. 130 rem check track 1 sector 0 for data already there
  15. 140 open1,8,15:open2,8,2,"#":gosub480
  16. 150 print#1,"u1:";2;0;1;0
  17. 160 get#2,a$:get#2,b$:ifasc(a$+chr$(0))<>0orasc(b$+chr$(0))<>0then gosub190
  18. 170 close2:close1:return
  19. 180 rem rewrite auto boot (y/n)
  20. 190 s1$="already an autoboot disk!"
  21. 200 s2$="should i continue? (y/n)":gosub820
  22. 210 get(NULL) a$
  23. 220 ifa$="y"then gf=1:gosub850:return
  24. 230 ifa$="n"then gosub 850:(NULL)1,7,6,"      program stopped",1:close2:close1:(NULL)5:(NULL) mo,1:(NULL)5,14:end:(NULL) goto210
  25. 240 rem write track 1, sector 0.
  26. 250 s1$="   enter bootup message":s2$="":gosub820
  27. 260 dn$="":gosub890:dn$=w$
  28. 270 gosub850:s1$="are you booting a basic or"
  29. 280 s2$="     ml program (b/m)     ":gosub820
  30. 290 get(NULL) a$
  31. 300 if a$="b" or a$="[194]" then ml=0:gosub850:goto 320
  32. 310 if a$="m" or a$="[205]" then ml=1:gosub850:(NULL) goto290
  33. 320 gosub850:s1$="   program to auto boot?":s2$="":gosub820
  34. 330 nm$="":gosub890:nm$=w$:iflen(nm$)=0then330
  35. 340 gosub850:(NULL)1,7,6,"writing auto boot...",1
  36. 350 ml$="cbm"+chr$(0)+chr$(0)+chr$(0)+chr$(0)+dn$+chr$(0)+chr$(0)+chr$(162)
  37. 360 ad=2816+len(dn$)+15
  38. 370 ml$=ml$+chr$(adand255)+chr$(160)+chr$(ad/256)+chr$(76)+chr$(165)
  39. 380 ml$=ml$+chr$(175)
  40. 390 if ml=0 then ml$=ml$+"run"
  41. 400 if ml=1 then ml$=ml$+"boot"
  42. 410 ml$=ml$+chr$(34)+nm$+chr$(0)
  43. 420 open1,8,15:open2,8,2,"#":gosub480
  44. 430 print#1,"b-p:";2;0
  45. 440 print#2,ml$;
  46. 450 print#1,"u2:";2;0;1;0:gosub480
  47. 460 close2:close1:return
  48. 470 rem read error channel
  49. 480 ifds>1then(NULL) mo,1:printds$:close2:close1:end
  50. 490 return
  51. 500 rem main body
  52. 510 gf=0
  53. 520 (NULL)1,7:s1$="   c128 auto boot maker"
  54. 530 s2$="  by d darus & l wallace":gosub820:(NULL)5
  55. 540 gosub80:rem insert disk
  56. 550 gosub140:rem check track 1 sector 0 for data already there.
  57. 560 gosub250:rem write track 1, sector 0.
  58. 570 ifgf=1then610
  59. 580 open1,8,15:fort=0to20:print#1,"b-a:" 0;1;t:next
  60. 590 ifds=65thengosub190:goto610
  61. 600 ifds>0thenprintds$
  62. 610 close1:s1$="all done!":s2$="press any key to end":gosub850:gosub820:get(NULL) a$:(NULL) mo,1:(NULL)5,14:end
  63. 620 (NULL)%:(NULL)1,1:(NULL)1,3
  64. 630 (NULL)1,13,2,"autodisk maker"
  65. 640 (NULL)1,1
  66. 650 (NULL)1,40,32,280,186
  67. 660 (NULL)1,160,105,32,25
  68. 670 (NULL)1,160,150,8,5,270,90
  69. 680 (NULL)1,152,150 to 152,170
  70. 690 (NULL)1,168,150 to 168,170
  71. 700 (NULL)1,160,170,8,5,90,270
  72. 710 (NULL)1,195,125,5,4
  73. 720 (NULL)1,276,63,280,70
  74. 730 (NULL)0,280,64 to 280,69
  75. 740 (NULL)1,7
  76. 750 (NULL)1,56,40,264,71,,1
  77. 760 (NULL)1,1
  78. 770 (NULL)1,45,40
  79. 780 (NULL)&
  80. 790 (NULL)"auto.pic",b0,d0,p8192 to p16191
  81. 800 (NULL)"auto.col",b0,d0,p7168 to p8191
  82. 810 return
  83. 820 (NULL)1,7,5,s1$,1
  84. 830 (NULL)1,7,7,s2$,1
  85. 840 return
  86. 850 (NULL)1,7:(NULL)1,7,5,"                          ",1: rem 27 spaces
  87. 860 (NULL)1,7,6,"                          ",1: rem 27 spaces
  88. 870 (NULL)1,7,7,"                          ",1: rem 27 spaces
  89. 880 return
  90. 890 ct=0:xp=7:tx$="":w$=""
  91. 900 get(NULL) tx$
  92. 910 a=asc(tx$)
  93. 920 ifa=13thenreturn
  94. 930 ifa=20andlen(w$)>0thenw$=left$(w$,len(w$)-1):tx$=" ":goto980
  95. 940 ifa=20then900
  96. 950 ifa$=chr$(34)then900
  97. 960 iflen(w$) >=16 then900
  98. 970 xp=xp+1:w$=w$+tx$
  99. 980 (NULL)1,xp,7,tx$,1:ifa=20thenxp=xp-1
  100. 990 goto900
  101.